package com.itheima.entity;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

@Data
public class DishDto extends Dish implements Serializable {
    private List<DishFlavor> flavors=new ArrayList<>();
    private String categoryName; //菜品分类名称
    private Integer copies;
    public DishDto() {
    }
    public DishDto(Dish dish, List<DishFlavor> flavorList) {
        super.setId(dish.getId());
        super.setName(dish.getName());
        super.setCategoryId(dish.getCategoryId());
        super.setPrice(dish.getPrice());
        super.setCode(dish.getCode());
        super.setImage(dish.getImage());
        super.setDescription(dish.getDescription());
        super.setStatus(dish.getStatus());
        super.setSort(dish.getSort());
        this.flavors=flavorList;
    }
}
